<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * MY_Model
 *
 * @author Simon Emms <simon@simonemms.com>
 */
class MY_Model extends CI_Model {






    /**
     *
     * Allow models to use other models
     *
     * This is a substitute for the inability to load models
     * inside of other models in CodeIgniter.  Call it like
     * this:
     *
     * $salaries = $this->_load_model('salary');
     * ...
     * $salary = $salaries->get_salary($employee_id);
     *
     * @param string $model_name The name of the model that is to be loaded
     * @param string $name The name to be assigned
     *
     * @return object The requested model object
     *
     */
    protected function _load_model($model_name, $name = null) {
        $objCI = &get_instance();
        if(is_null($name)) { $name = $model_name; }
        $objCI->load->model($model_name, $name);
        $this->$name = $objCI->$name;
        return $objCI->$name;
    }
    
    
    
    
}

?>